<template>
    <div id="myChart"></div>
</template>

<script setup lang="ts">
import * as echarts from 'echarts'
import { reactive, onMounted } from 'vue'
const state = reactive({
    option: {
        title: {
            text: '公司发展表格',
        },
        xAxis: {
            type: 'category',
            data: ['2019年', '2020年', '2021年', '2022年', '2023年'],
        },
        yAxis: {
            type: 'value',
            data: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90],
        },
        series: [
            {
                data: [0, 10, 30, 50, 90],
                type: 'line',
                // smooth: true,
            },
        ],
    },
})
const initeCharts = () => {
    let myChart = echarts.init(document.getElementById('myChart'))
    // 绘制图表
    myChart.setOption(state.option)
}
onMounted(() => {
    initeCharts()
})
</script>

<style lang="less" scoped></style>
